package datamining.miner.general;

import java.util.BitSet;

import datamining.miner.chain.Extension;
import datamining.miner.enviroment.ThreadEnvironment;

/**
 * <p>
 * 创建于 2012-12-18 下午10:41:20
 * 
 * @author xujinghu (jinghuxu@nudt.edu.cn) <br>
 *         Copyright 2012 xujinghu <br>
 *         Lisence: Apache
 */
public interface ExtendedEmbedding<ItemType> extends Embedding<ItemType> {

	/**
	 * checks if the given Extension can be mapped to this embedding
	 * 
	 * @param ext
	 * @return <code>true</code>, if at least one supergraph edge is
	 *         represented by the given extension
	 */
	public boolean mapExtension(Extension<ItemType> ext);

	/**
	 * searches a item of the given set the given Extension can be mapped to
	 * in this embedding
	 * 
	 * @param ext
	 * @param allowedEdges
	 * @return the found edge
	 */
	public int mapExtension(Extension<ItemType> ext, BitSet allowedItems);

	/**
	 * stores this embedding to the given <code>target</code> environment,
	 * if possible
	 * 
	 * @param target
	 */
	public abstract void release(final ThreadEnvironment<ItemType> target);

}
